package com.constructor;

/**
 * Time    : 2023/3/19 15:33
 * Author  : 王摇摆
 * FileName: Son.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

public class Son extends Father {
    private String name;

    public Son() {
        System.out.println("子类无参构造器已执行");
    }

    public Son(String name) {
        this.name = name;
        System.out.println("子类单参数构造器已执行");

    }

    public Son(String name, String name1) {
        super(name);
        this.name = name1;
        System.out.println("子类双参数构造器已执行");

    }

    public String getFatherName(){
        return super.getName();
    }

    public String getSonName(){
        return this.name;
    }
}
